/**
 * @file demo172.c
 * @author WRS (1352509846@qq.com)
 * @brief 阶乘后的0
 * 给定一个整数n，返回n!结果位数中0的个数
 * @version 0.1
 * @date 2021-09-02
 * 
 * @copyright Copyright (c) 2021
 * 
 */

#include <stdio.h>

int trailingZeroes(int n)
{
    if(n<25) return n/5;

    int result = 0;
    long long temp = 1;
    for(int i=0; i<=n; i++)
    {
        temp *= i;
        while (temp % 10 ==0)
        {
            /* code */
            result++;
            temp/=10;
        }
        if(temp>100000) temp = temp %100000;
    }
    return result;
}

int main(int argc, char const *argv[])
{
    
    return 0;
}
